<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<script src="https://cdn.jsdelivr.net/npm/vue@2.5.16/dist/vue.js"></script>
<script src="https://unpkg.com/axios/dist/axios.min.js"></script>
<div id="app">
    账号:<input type="text" :value="name">
    密码:<input type="text" :value="password">
    <button @click="hello">提交</button>
</div>

</body>
<script>
    var vm = new Vue({
        el: "#app",
        data: {
            token: '',
            name:'',
            password: ''
        },
        methods: {
            hello() {

                axios.get('/login/login', {
                    params:{
                        name:'ccc',
                        password: '123456'
                    }
                })
                    .then(response => {
                        console.log(response.data);
                        vm.token = response.data.data.token
                    }).catch(error => {
                    console.log("请求失败")
                })

            },

            hi() {

            }
        }


    })
</script>
</html>